﻿using System.Collections.Generic;
using System.ServiceModel;
using VNet.VisiSuite.Service.Contact.Message;
using VNet.VisiSuite.Service.Contact.Message.Base;
using VNet.VisiSuite.Service.Contact.Message.Item;

namespace VNet.VisiSuite.Service.Interface
{
    [ServiceContract(Namespace = VisiSuiteNamespace.Uri + "IVNetVisiSuiteService")]
    public interface IVNetVisiSuiteService
    {
        #region Plants
        [OperationContract]
        GetDataResponse<IList<PlantItem>> GetPlants(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<IList<PlantItem>> UpdatePlants(SavePlantRequest request);

        [OperationContract]
        SaveDataResponse<PlantItem> UpdatePlant(SaveDataRequest<PlantItem> request);

        [OperationContract]
        SaveDataResponse<PlantItem> InsertPlant(SaveDataRequest<PlantItem> request);

        [OperationContract]
        DeleteDataResponse DeletePlant(DeleteDataRequest request);
        #endregion

        #region User
        [OperationContract]
        GetDataResponse<IList<UserLoginItem>> GetUsers(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<UserLoginItem> UpdateUser(SaveDataRequest<UserLoginItem> request);

        [OperationContract]
        SaveDataResponse<UserLoginItem> InsertUser(SaveDataRequest<UserLoginItem> request);

        [OperationContract]
        DeleteDataResponse DeleteUser(DeleteDataRequest request);
        #endregion

        #region Product
        [OperationContract]
        GetDataResponse<IList<ProductItem>> GetProducts(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<ProductItem> UpdateProduct(SaveDataRequest<ProductItem> request);

        [OperationContract]
        SaveDataResponse<ProductItem> InsertProduct(SaveDataRequest<ProductItem> request);

        [OperationContract]
        SaveDataResponse<IList<ProductItem>> ImportProducts(SaveDataRequest<IList<ProductItem>> request);

        [OperationContract]
        DeleteDataResponse DeleteProduct(DeleteDataRequest request);
        #endregion

        #region Production Plan
        [OperationContract]
        GetDataResponse<IList<ProductionPlanItem>> GetProductionPlans(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<ProductionPlanItem> UpdateProductionPlan(SaveDataRequest<ProductionPlanItem> request);

        [OperationContract]
        SaveDataResponse<ProductionPlanItem> InsertProductionPlan(SaveDataRequest<ProductionPlanItem> request);

        [OperationContract]
        DeleteDataResponse DeleteProductionPlan(DeleteDataRequest request);

        [OperationContract]
        SaveDataResponse<IList<ProductionPlanItem>> ImportProductionPlans(SaveDataRequest<IList<ProductionPlanItem>> request);
        #endregion

        #region Areas

        #region Area
        [OperationContract]
        SaveDataResponse<AreaItem> UpdateArea(SaveDataRequest<AreaItem> request);

        [OperationContract]
        SaveDataResponse<AreaItem> InsertArea(SaveDataRequest<AreaItem> request);

        [OperationContract]
        DeleteDataResponse DeleteArea(DeleteDataRequest request);
        #endregion

        #region AreaShifts
        [OperationContract]
        GetDataResponse<IList<AreaShiftItem>> GetAreaShifts(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<AreaShiftItem> InsertAreaShift(SaveDataRequest<AreaShiftItem> request);

        [OperationContract]
        SaveDataResponse<AreaShiftItem> UpdateAreaShift(SaveDataRequest<AreaShiftItem> request);

        [OperationContract]
        DeleteDataResponse DeleteAreaShift(DeleteDataRequest request);
        #endregion

        #region LaunchApplications
        [OperationContract]
        GetDataResponse<IList<LaunchApplicationItem>> GetLaunchApplications(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<LaunchApplicationItem> UpdateLaunchApplication(SaveDataRequest<LaunchApplicationItem> request);

        [OperationContract]
        SaveDataResponse<LaunchApplicationItem> InsertLaunchApplication(SaveDataRequest<LaunchApplicationItem> request);

        [OperationContract]
        DeleteDataResponse DeleteLaunchApplication(DeleteDataRequest request);

        [OperationContract]
        SaveDataResponse<IList<LaunchApplicationItem>> MoveLaunchApplication(SaveDataRequest<LaunchApplicationItem> request);
        #endregion

        #region ReasonCode
        [OperationContract]
        GetDataResponse<IList<ReasonCodeItem>> GetReasonCodes(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<ReasonCodeItem> InsertReasonCode(SaveDataRequest<ReasonCodeItem> request);

        [OperationContract]
        SaveDataResponse<ReasonCodeItem> UpdateReasonCode(SaveDataRequest<ReasonCodeItem> request);

        [OperationContract]
        DeleteDataResponse DeleteReasonCode(DeleteDataRequest request);

        [OperationContract]
        GetDataResponse<IList<RollupDefinitionItem>> GetRollupDefinitionsAsSource(GetDataRequest request);

        [OperationContract]
        GetDataResponse<ProductionPlanReferenceItem> GetProductionPlanReference(GetDataRequest request);
        #endregion

        #region RollupDefinition
        [OperationContract]
        GetDataResponse<IList<RollupDefinitionItem>> GetRollupDefinitions(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<RollupDefinitionItem> UpdateRollupDefinition(SaveDataRequest<RollupDefinitionItem> request);

        [OperationContract]
        SaveDataResponse<RollupDefinitionItem> InsertRollupDefinition(SaveDataRequest<RollupDefinitionItem> request);

        [OperationContract]
        DeleteDataResponse DeleteRollupDefinition(DeleteDataRequest request);

        [OperationContract]
        SaveDataResponse<IList<RollupDefinitionItem>> MoveRollupDefinition(SaveDataRequest<RollupDefinitionItem> request);
        #endregion

        #region AlarmSetting
        [OperationContract]
        GetDataResponse<IList<AlarmSettingItem>> GetAlarmSettings(GetDataRequest request);

        [OperationContract]
        SaveDataResponse<AlarmSettingItem> UpdateAlarmSetting(SaveDataRequest<AlarmSettingItem> request);

        [OperationContract]
        SaveDataResponse<AlarmSettingItem> InsertAlarmSetting(SaveDataRequest<AlarmSettingItem> request);

        [OperationContract]
        DeleteDataResponse DeleteAlarmSetting(DeleteDataRequest request);

        #endregion

        #region ScrapReasonCode
        [OperationContract]
        GetDataResponse<IList<ReasonCodeItem>> GetScrapReasonCodes(GetDataRequest request);
        #endregion

        #region Scheduled Downtime

        [OperationContract]
        GetDataResponse<IList<ScheduledDowntimeItem>> GetScheduledDowntimes(GetDataRequest request);


        [OperationContract]
        SaveDataResponse<ScheduledDowntimeItem> UpdateScheduledDowntime(SaveDataRequest<ScheduledDowntimeItem> request);


        [OperationContract]
        SaveDataResponse<ScheduledDowntimeItem> InsertScheduledDowntime(SaveDataRequest<ScheduledDowntimeItem> request);


        [OperationContract]
        DeleteDataResponse DeleteScheduledDowntime(DeleteDataRequest request);


        #endregion

        #region Scheduled Repeat

        [OperationContract]
        GetDataResponse<IList<ScheduledRepeatItem>> GetScheduledRepeat(GetDataRequest request);


        [OperationContract]
        SaveDataResponse<ScheduledRepeatItem> UpdateScheduleRepeat(SaveDataRequest<ScheduledRepeatItem> request);


        [OperationContract]
        SaveDataResponse<ScheduledRepeatItem> InsertScheduleRepeat(SaveDataRequest<ScheduledRepeatItem> request);


        [OperationContract]
        DeleteDataResponse DeleteScheduledRepeat(DeleteDataRequest request);


        #endregion


        #endregion

        #region Cell
        [OperationContract]
        SaveDataResponse<CellItem> UpdateCell(SaveDataRequest<CellItem> request);

        [OperationContract]
        SaveDataResponse<CellItem> InsertCell(SaveDataRequest<CellItem> request);

        [OperationContract]
        DeleteDataResponse DeleteCell(DeleteDataRequest request);
        #endregion

        #region Sync

        [OperationContract]
        ConfigureResponse VerifyCellAndGetServerData(ConfigureRequest request);

        [OperationContract]
        ConfigureResponse SyncDataFromServerToClient(ConfigureRequest request);

        [OperationContract]
        SyncDataFromClientResponse SyncDataFromClientToServer(SyncDataFromClientRequest request);
        #endregion

        #region VisiCentral

        [OperationContract]
        GetDataResponse<IList<CellItem>> GetCells(GetDataRequest request);

        [OperationContract]
        ProductionDataResponse GetProductionData(ProductionDataRequest request);

        [OperationContract]
        AnalysisChartDataResponse GetAnalysisChartData(AnalysisChartDataRequest request);

        #endregion

#if DEBUG
        // TODO: Remove this region below on final build.
        #region VisiCentral Test Data

        [OperationContract]
        GetDataResponse<bool> CreateDataTest();

        [OperationContract]
        GetDataResponse<bool> CreateProductionHistoryAtInterval();

        #endregion
#endif
    }
}